package com.hrpmar.utils;

/**
 * Created by dell on 2017/11/18.
 */
public class StringFormat {

    public static String StringFormat(String string,int length){
        StringBuffer buffer = new StringBuffer();
        if(string!=null&&string!=""){
            if (string.length()>length){
                buffer.append(string.substring(0,length)+"...");
            }else {
                buffer.append(string);
            }
        }
        return buffer.toString();
    }

}
